﻿#ifndef FINGERWGT_H
#define FINGERWGT_H


#include <QThread>
#include <QWidget>

#include "FingerModule.h"

QT_BEGIN_NAMESPACE
namespace Ui { class FingerWgt; }
QT_END_NAMESPACE

//指纹模块的交互界面类.
class FingerWgt : public QWidget
{
    Q_OBJECT

public:
    FingerWgt(QWidget *parent = nullptr);
    ~FingerWgt();
    void forceStop();

signals:
    void sigPlayViocePrompt(QString text); //通知上层播放提示声.
    void sigSendCtrlCmd(int ctrlCmd, int param1=-1, int param2=-1, int param3=-1, int param4=-1);
    void sigUserSign(int fingerId); //用户签到.
    void sigUserLoginOver(bool flag, int fingerId, QString info); //用户注册结束.

public slots:
    void onShowMsg(QString msg);
    void onUpdateConList(); //更新指纹索引表.

    void onUserLogin(); //切换到自动登录模式.
    void onUserSearch(); //切换到自动搜索模式.
    void onRemoveFinger(int fingerId); //移除指纹.

private:
    void setupSignals();

private:
    Ui::FingerWgt *ui;

    FingerModule *m_finger {nullptr};
    QThread *m_th {nullptr};
};
#endif // FINGERWGT_H
